package com.hxzy.tms;

import com.hxzy.tms.entity.User;

public class SessionHolder {
	/***
	 * 登入用户存储在上下文中，必要时获取
	 */
	  private final static ThreadLocal<User> holder=new ThreadLocal<User>();
	    public static final User get() {
	        return holder.get();
	    }

	    public static final void set(User session) {
	        holder.set(session);
	    }
	    //清除当前存储用户
	    public static final void clear() {
	        holder.remove();
	    }
}
